#!/bin/sh -e

# $1 = version

DIR=liblaf-plugin-java-$1
ZIP=laf-plugin-src.zip
TAR=../liblaf-plugin-java_$1.orig.tar.gz

wget https://laf-plugin.dev.java.net/files/documents/4261/41254/$ZIP

# clean up the upstream tarball
unzip -d $DIR $ZIP
tar -c -z -f $TAR $DIR
rm -rf $DIR $ZIP

# move to directory 'tarballs'
if [ -r .svn/deb-layout ]; then
  . .svn/deb-layout
  mv $TAR $origDir
  echo "moved $TAR to $origDir"
fi

exit 0
